package teachers;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class MyPartitioner extends Partitioner<Text, IntWritable> {

	@Override
	public int getPartition(Text key, IntWritable value, int numReduceTasks) {
		char first = key.toString().charAt(0);
		if (first >= 'a' && first <= 'g') {
			return 0;
		} else if (first > 'g' && first <= 'n') {
			return 1;
		} else {
			return 2;
		}

	}
}
